//审核未通过
function delCodeComment(codeCommentId){
	jQuery.ajax({
		type : "POST",
		url : ctx + "/codeManage/delCodeComment/"+codeCommentId,
		data : "",
		dataType : "json",
		success : function(data) {
			alert(data.msg);
			commentUnCheckInit();
		}
	});
}
//审核通过
function passCodeComment(codeCommentId){
	jQuery.ajax({
		type : "POST",
		url : ctx + "/codeManage/passCodeComment/"+codeCommentId,
		data : "",
		dataType : "json",
		success : function(data) {
			alert(data.msg);
			commentUnCheckInit();
		}
	});
}
function commentUnCheckInit(){
	jQuery.ajax({
		type : "GET",
		url : ctx + "/codeManage/selUnCheckCodeComments",
		data : "",
		dataType : "json",
		success : function(codeComments) {
			$("#unCheckComments").empty();
			if(codeComments.code = "1"){
				$.each(codeComments.data,function(i) {
					var commentStr = getCommentViewLabel(codeComments.data[i],i);
					$("#unCheckComments").append(commentStr);
				});
			}else{
				alert(codeComments.msg);
			}

		}
	});
}
function getCommentViewLabel(codeComments,i){
	var str =  "<tr >"
		+"<td>"+codeComments.codeCommentId+"</td>"
		+"<td>"+codeComments.codeCommentContent+"</td>"
		+"<td>"+codeComments.nickname+"</td>"
		+"<td><a href=\"#\" onclick='passCodeComment("+codeComments.codeCommentId+")' class=\"btn btn-info\">YES</a> &nbsp; <a href=\"#\" onclick='delCodeComment("+codeComments.codeCommentId+")' class=\"btn btn-danger\">NO</a></td>"
		+"</tr>"
	return str;
}

